package com.mango.game.common;

import com.mango.game.dtos.RequestContextDTO;

public class RequestContextHolder {

    private static final ThreadLocal<RequestContextDTO> USER_CONTEXT = new InheritableThreadLocal<>();

    public static void setRequestContext(RequestContextDTO requestContext) {
        USER_CONTEXT.set(requestContext);
    }

    public static RequestContextDTO getRequestContext() {
        return USER_CONTEXT.get();
    }

    public static void clear() {
        USER_CONTEXT.remove();
    }

}
